package com.xiaoma.myaudience.biz.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.xiaoma.myaudience.biz.util.Constant;

public class CategorySearchUrlInfo extends BaseVideoInfo {
	private String mType;
	private String mTypeid;
	private String mAreaid;
	private String mOrderby;
	private String mStart;
	private String mLength;
    
    public void setType(String type) {
    	this.mType = type;
    }
    public void setTypeID(String typeid) {
    	this.mTypeid = typeid;
    }
    public void setAreaID(String areaid) {
    	this.mAreaid = areaid;
    }
    public void setStart(String start) {
    	this.mStart = start;
    }
    public void setOrderby(String orderby) {
    	this.mOrderby = orderby;
    }
    public void setLength(String length) {
    	this.mLength = length;
    }
    
    public String getType() {
    	return this.mType;
    }
    public String getTypeID() {
    	return this.mTypeid;
    }
    public String getAreaID() {
    	return this.mAreaid;
    }
    public String getStart() {
    	return this.mStart;
    }
    public String getOrderby() {
    	return this.mOrderby;
    }
    public String getLength() {
    	return this.mLength;
    }
    /**
     * 生成获取分类搜索列表的url
     * 
     * @param info
     */
    public String getCategorySearchUrl() {
		return String.format(Constant.URL_CATEGORY_SEARCH_LIST, this.mType, this.mTypeid, this.mAreaid, this.mOrderby, this.mStart, this.mLength);
    }
    
    @Override
    public void writeToParcel(Parcel parcel, int paramInt) {
        super.writeToParcel(parcel, paramInt);
        parcel.writeString(mType);
        parcel.writeString(mTypeid);
        parcel.writeString(mAreaid);
        parcel.writeString(mOrderby);
        parcel.writeString(mStart);
        parcel.writeString(mLength);
    }  
    
    @Override
    public void readFromParcel(Parcel source) {
        super.readFromParcel(source);
        mType = source.readString();
        mTypeid = source.readString();
        mAreaid = source.readString();
        mOrderby = source.readString();
        mStart = source.readString();
        mLength = source.readString();
    }

    public static final Parcelable.Creator<CategorySearchUrlInfo> CREATOR = new Creator<CategorySearchUrlInfo>() {
        public CategorySearchUrlInfo createFromParcel(Parcel source) {
        	CategorySearchUrlInfo info = new CategorySearchUrlInfo();
            info.readFromParcel(source);
            return info;
        }

        public CategorySearchUrlInfo[] newArray(int size) {
            return new CategorySearchUrlInfo[size];
        }
    };
}
